// import Vue from 'vue'
import { createRouter, createWebHistory} from 'vue-router'

import HomePage from '../views/HomePage.vue'

// Vue.useAttrs(VueRouter)

const routes = [
    {
    path: '/',
    component: HomePage,
    // 子路由
    children: [
    {
        path: '/index',
        component: () => import('../views/index/indexPage.vue')
    },
    {
        path: '/rank',
        component: () => import('../views/index/RankPage.vue')
    },
    {
        path: '/about',
        component: () => import('../views/index/AboutPage.vue')
    },
    {
        path: '/movie',
        component: () => import('../views/movie/MoviePage.vue'),
        children:[
            {
                path: '/hotmovie',
                component: ()=> import('../components/movie/HotMovie.vue')
            },
            {
                path: '/recentmovie',
                component: ()=> import('../components/movie/RecentMovie.vue')
            },
            {
                path: '/classmovie',
                component: ()=> import('../components/movie/ClassMovie.vue')
            }
        ]
    }

    ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})


export default router